C[x](Rb[u], {
    ta: function() {
        var a = this,
        b = a.map;
        b[B]("loadcode", 
        function() {
            a.ml()
        });
        b[B]("addtilelayer", 
        function(b) {
            a.Ai(b)
        });
        b[B]("removetilelayer", 
        function(b) {
            a.hj(b)
        });
        b[B]("setmaptype", 
        function(b) {
            a.Ue(b)
        });
        b[B]("zoomstartcode", 
        function(b) {
            a.ur(b)
        });
        a.Xp(b)
    },
    ml: function() {
        if (C.O.T) try {
            da.execCommand("BackgroundImageCache", l, f)
        } catch(a) {}
        this.Ab && C.w.G(this.Ab);
        this.loaded || (this.gl(), this.loaded = f);
        this.oe()
    },
    Ou: function() {
        this.Xp(this.map);
        this.ml()
    },
    Xp: function(a) {
        var b = this;
        a[B]("mousewheel", 
        function(a) {
            b.aA(a)
        });
        a[B]("dblclick", 
        function(a) {
            b.bs(a)
        });
        a[B]("rightdblclick", 
        function(a) {
            b.bs(a)
        });
        a[B]("minuspress", 
        function(a) {
            b.Xs(a)
        });
        a[B]("pluspress", 
        function(a) {
            b.Xs(a)
        });
        a[B]("moving", 
        function() {
            b.oe()
        });
        a[B]("resize", 
        function() {
            b.oe()
        })
    },
    Ai: function(a) {
        for (var a = a.target, b = 0; b < this.ed[w]; b++) if (this.ed[b] == a) return;
        this.ed.push(a);
        a.ta(this.map, this.oi);
        this.map.loaded && this.oe()
    },
    hj: function(a) {
        var a = a.target,
        b = this.Nd,
        c = this.ag,
        d;
        for (d in c) {
            var e = d.split("-")[1];
            e == a.K && delete c[d]
        }
        for (d in b) e = d.split("-")[1],
        e == a.K && delete b[d];
        d = 0;
        for (b = this.ed[w]; d < b; d++) a == this.ed[d] && this.ed.splice(d, 1);
        a.remove();
        this.oe()
    },
    aA: function(a) {
        var b = this.map;
        if (b.J.Li) {
            var c = b.Xg(b.va + (a.Ep == f ? 1: -1));
            c.lo || (b.dispatchEvent(new Q("onzoomstart")), b.Wb = b.va, b.va = c.zoom, a = a.Aa, c = this.Fq(a), zoomUnits = b.ba().ob(b.ha()), b.Gb = new K(c.lng + (b[y] / 2 - a.x) * zoomUnits, c.lat - (b[A] / 2 - a.y) * zoomUnits), b.Dd = b.lc.qf(b.Gb, b.ib), this.zoom(a))
        }
    },
    bs: function(a) {
        var b = this.map;
        if (b.J.ao) {
            var c = a.Aa,
            d = 1,
            e = c,
            g = new P(0, 0);
            "onrightdblclick" == a.type && (d = -1, e = new S(b[y] / 2, b[A] / 2));
            a = b.Xg(b.va + d);
            a.lo ? 1 == d && (c = b.Ma(c), b.qd(c)) : (b.dispatchEvent(new Q("onzoomstart")), b.Wb = b.va, b.va = a.zoom, 1 == d && (b.Gb = this.Fq(c), b.Dd = b.lc.qf(b.Gb, b.ib), d = 0.5 * (b.ba().ob(b.Wb) / b.ba().ob(a.zoom)), g[y] = c.x - p.round(b[y] / 2) * d, g[A] = c.y - p.round(b[A] / 2) * d), this.zoom(e, g))
        }
    },
    Xs: function(a) {
        var b = this.map;
        if (b.J.Ki) {
            if (!this.de) {
                var c = b.Xg(b.va + ("onpluspress" == a.type ? 1: -1));
                c.lo || (b.dispatchEvent(new Q("onzoomstart")), a = new S(b[y] / 2, b[A] / 2), b.Wb = b.va, b.va = c.zoom, b.Me() && (a = b.$a(b.Me().V(), b.Wb), c = b.Ma(a, b.Wb), b.Vf(b[y] / 2 - a.x, b[A] / 2 - a.y, c, f)), this.zoom(a))
            }
        } else "onpluspress" == a.type ? b.Fp() : b.Gp()
    },
    Fq: function(a) {
        var b = this.map,
        c = b.Gb,
        d = b.ba().ob(b.Wb);
        return new K(c.lng + d * (a.x - b[y] / 2), c.lat - d * (a.y - b[A] / 2))
    },
    zoom: function(a, b) {
        var c = b ? b[y] : 0,
        d = b ? b[A] : 0,
        e = this.map,
        g = e.J,
        i = this,
        j = a.x - t(i.lb.style.left) - e[ia],
        n = a.y - t(i.lb.style.top) - e[ja];
        e.Vc && C.w.G(e.Vc);
        i.oi.style.visibility = "hidden";
        this.kr();
        i.Yg.style.visibility = "hidden";
        var q = [],
        s = e.va - e.Wb;
        i.ci ? 0 < e.va - e.Wb ? i.ci++:i.ci--:i.ci = s;
        this.de && 0 == this.de.Dl && (this.de.stop(), this.de = k, s = i.ci);
        if ((!b || 0 == b[y] && 0 == b[A]) && g.Ki) e.B.wB.action(a, 0 < s ? f: l);
        var s = p.pow(2, s),
        z = this.Ab,
        E = z.style;
        E.visibility = "";
        for (var F = z.children[w] - 1; - 1 < F; F--) {
            var I = {},
            G = z.children[F].style;
            I.top = t(G.top) || 0;
            I.left = t(G.left) || 0;
            I[y] = t(G[y]);
            I[A] = t(G[A]);
            I.vy = I[y] * s - I[y];
            I.my = I[A] * s - I[A];
            I.Mc = (I.left - j) * s - (I.left - j);
            I.Nc = (I.top - n) * s - (I.top - n);
            q[F] = I
        }
        z.xw = t(z.style.left);
        z.Bw = t(z.style.top);
        this.de && (this.de.stop(), this.de = k);
        this.de = new Ta({
            Oc: 20,
            duration: g.Ki ? g.xB: 1,
            ud: Ua.Zn,
            Sa: function(a) {
                if (! (a < 0.1)) {
                    for (var b = q[w] - 1; b > -1; b--) {
                        var e = q[b];
                        if (z.children[b]) {
                            var g = z.children[b].style;
                            g.top = p.round(e.top + e.Nc * a) + "px";
                            g.left = p.round(e.left + e.Mc * a) + "px";
                            g[y] = p.ceil(e[y] + e.vy * a) + "px";
                            g[A] = p.ceil(e[A] + e.my * a) + "px"
                        }
                    }
                    if (c || d) {
                        E.left = z.xw - c * a + "px";
                        E.top = z.Bw - d * a + "px"
                    }
                }
            },
            finish: function() {
                i.oe();
                e.Vc && (C.O.T && C.O.T < 8 || da.compatMode == "BackCompat" ? C.w.show(e.Vc) : setTimeout(function() {
                    C.w.show(e.Vc)
                },
                100));
                i.oi.style.visibility = "";
                i.Yg.style.visibility = "";
                delete i.ci;
                e.dispatchEvent(new Q("onzoomend"));
                i.Yq();
                z = k;
                i.de = k
            }
        })
    },
    Ue: function() {
        var a = this,
        b = a.map;
        this.kr(f);
        b[B]("tilesloaded", 
        function() {
            setTimeout(function() {
                a.Yq()
            },
            200);
            b.removeEventListener("tilesloaded", arguments.callee)
        });
        for (var c in this.Nd) 
        	this.Lo(this.Nd[c]);
        for (c in this.ag) 
        	this.Lo(this.ag[c]);
        c = this.zh;
        for (var d = 0, e = c[w]; d < e; d++) 
        	c[d].remove();
        delete this.lb;
        this.zh = [];
        this.ag = this.Nd = {};
        this.gl();
        this.oe()
    },
    kr: function(a) {
        var b = this.map,
        a = a || l;
        this.Ab ? this.Ab[ka] && !this.de && (this.Ab[ka][ga](this.Ab), this.Ab = k, this.Ab = a ? this.Yg.cloneNode(f) : this.lb.cloneNode(f)) : this.Ab = a ? this.Yg.cloneNode(f) : this.lb.cloneNode(f);
        var a = this.Ab,
        c = a.style;
        c.display = "";
        c.zIndex -= 100;
        b.platform.insertBefore(a, b.platform.firstChild)
    },
    Yq: function() {
        this.Ab && (Ub(this.Ab), this.Ab[ka] && (this.Ab[ka][ga](this.Ab), this.Ab.innerHTML = "", this.Ab = k))
    }
});